A database may provide a file repository that can be accessed via a variety of file system-based interfaces, such as those utilizing HTTP/WebDAV (Web Distributed Authoring and Versioning) or NFS (Network File System). Through such interfaces to the repository, a file is located, for example, via its URL or path and the repository is exposed as a hierarchical set of files and folders (e.g., directories). Further, data-oriented access mechanisms can be used to access a file repository, which expose the repository as a flat set of files that can be queried based on file content or attributes.
Files (i.e., generally, “resources”) can be versioned, for example, in order to keep a record of changes to files, to provide the option to revert to an older version of a file, and to get information on who made each change to a file and the progression of changes to the file. Thus, a version-controlled file is one whose versions are tracked by the repository. Because each version may need to be indexed and accessed as a separate entity, each version is typically stored in a separate row of a database table.
When a version-controlled file is checked out of the repository, updated and then checked back into the repository, a new version is created. This new, checked-in version is known as a successor of the old, checked-out version. Similarly, the old version is known as a predecessor of the new version. A version may have multiple successors, due to branches in the version history. Likewise, a version may have multiple predecessors, due to version merges. When a version is connected to another version by traversing one or more predecessor relations, it is called an “ancestor” of that version. When a version is connected to another version by traversing one or more successor relations, it is called a “descendant” of that version.
When tracking changes to a file, it is often necessary to find out what versions were the ancestors (or sometimes just the predecessors) of a given version and what versions were the descendants of the given version. This predecessor/descendant information assists in building a visualization of the version history tree, or parts of the version history tree, for a user. It becomes especially important in data-oriented access mechanisms, such as repository views, where one can use this functionality to restrict a given query to all versions prior to a given version, for example.
In view of the foregoing, there is a need for techniques for efficiently locating ancestors and descendants of a given version in a version history, in a repository that supports versioning of resources.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.